package com.gufe.controller.user.mp;

import com.gufe.result.Result;
import com.gufe.entity.PrecollectMember;
import com.gufe.service.user.mp.PrecollectMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/index")
public class PrecollectMemberController {

    @Autowired
    private PrecollectMemberService precollectMemberService;

    @PostMapping("/submit")
    public Result<String> submitPrecollectMember(@RequestBody PrecollectMember precollectMember) {
        try {
            precollectMemberService.submitPrecollectMember(precollectMember);
            return Result.success("提交成功");
        } catch (Exception e) {
            return Result.error("提交失败: " + e.getMessage());
        }
    }
}
